<div class="g12 nodrop" style="margin-bottom: 43px; width: 520px;">

    <h1> Pregled za naslovnu </h1>

    <p style="line-height: 13px;">

        Izgled na naslovnoj 

    </p>

<!--POSLEDNJI CLANAK-->
<?if(isset($last[0])){?>

    <?for($i=0;$i<1;$i++){?>
        <article>
            <section>
                <div id="naslovnan">
                    <div id="naslovnaimg" class="separator">


                        <a href="javascript:" class="mPhoto">
                            <div id="slider-1" class="nivoSlider"><?                        

                                    $articleImagesMain = $this->datam->getMediaImagesForArticle($last[0]['id']);
                                    $w = 482;
                                    $h = 321;
                                    if(count($articleImagesMain)>1){

                                        foreach($articleImagesMain as $aimg){?>
                                        <img src="<?=$url.'cache/'.$this->img_map->showImage($aimg['mFile'],$w,$h,"exacttop");?>" alt="<?=$aimg['caption']?>" title="<?=$aimg['caption']?>" width="<?=$w?>" height="<?=$h?>" />                     
                                        <?}

                                    }else{
                                        switch($last[0]['mType']){
                                            case 'img':?>
                                            <img src="<?=$url.'cache/'.$this->img_map->showImage($last[0]['mFile'],$w,$h,"exacttop");?>" alt="<?=$last[0]['caption']?>" title="<?=$last[0]['caption']?>" width="<?=$w?>" height="<?=$h?>" />
                                            <? break;

                                            case 'yt':?>
                                            <img src="<?=$url.'cache/'.$this->img_map->showImage($last[0]['mFile'].".jpg",$w,$h,"exacttop");?>" alt="<?=$last[0]['caption']?>" title="<?=$last[0]['caption']?>" width="<?=$w?>" height="<?=$h?>" />
                                            <div class="videoBig">&nbsp;</div>
                                            <? break;
                                        } 
                                    }

                                ?>                    

                            </div>

                            <div class="nadnaslov overwrite">
                                <div class="opct w1"></div>
                                <span><?=$last[0]['caption']?></span>
                            </div> 

                        </a> 

                    </div>

                    <div class="spacer"></div> 

                    <h2><a class="mLink" href="javascript:"><?=$last[0]['title']?></a></h2>

                    <div class="intro">
                        <? if($last[0]['status']==1){?> 
                            <span class="flag updated">Ажуриранo</span>
                            <?}else{?>
                            <span class="flag new">Ново</span>
                            <?}?>
                    <?=$last[0]['intro']?> </div>

                </div>

            </section>  
        </article>
        <?}?>
    <?}?>

<div style="clear: both; width: 100%;"></div>

<!--4 SIDE-->

<?
    $cnt = count($four_side);
    for($k=1;$k<3;$k++){

        if($k%4==0){?>

        <div class="kocka">

            <?}else{?>

            <div class="kocka marginleft" style="margin-top: 23px;">

                <?}

                $cssBgImageOverwrite = "";
                $cssBorderOverwrite = "";

                switch($four_side[0]['mType']){

                    case 'yt':
                        $cssBgImageOverwrite = 'blue';
                        $cssBorderOverwrite = 'kockaimgVid';
                        break;
                }

            ?>

            <div class="kockaimg <?=$cssBorderOverwrite?>">
                <a href="javascript:" class="mPhoto">
                    <?
                        $w = 247;
                        $h = 164;
                        switch($four_side[0]['mType']){
                            case 'img':
                            $css_title = 'w2';
                            ?>
                            <img src="<?=$url.'cache/'.$this->img_map->showImage($four_side[0]['mFile'],$w,$h,"exacttop");?>" alt="<?=$four_side[0]['caption']?>" title="<?=$four_side[0]['caption']?>" width="<?=$w?>" height="<?=$h?>" />
                            <?
                                break;

                            case 'yt':
                            $css_title = 'w2_vid'
                            ?>
                            <img src="<?=$url.'cache/'.$this->img_map->showImage($four_side[0]['mFile'].".jpg",$w,$h,"exacttop");?>" alt="<?=$four_side[0]['caption']?>" title="<?=$four_side[0]['caption']?>" width="<?=$w?>" height="<?=$h?>" />
                            <div class="videol">&nbsp;</div><?
                                break;
                        }

                    ?>

                    <div class="nadnaslov"><div class="opct <?=$cssBgImageOverwrite?> <?=$css_title?>"></div><span><?

                                if ($four_side[0]['mType']=='yt'){
                                    echo 'Video';
                                }else{
                                    if(strlen($four_side[0]['uptitle'])>43){
                                        echo $four_side[0]['cName'];
                                    }else echo $four_side[0]['uptitle']; 
                                }

                        ?></span></div>
                </a> 

            </div>
            <div style="clear: both;"></div>
            <h3><a class="mLink" href="javascript:"><?=$four_side[0]['title']?></a></h3>

        </div>

        <?
            if($k%4==0) echo '<div class="style="clear:both"></div>';
        ?>

        <?}?> 


<div class="clearfix <? if($page=='article')echo 'brd0';?>" id="novevijesti" style="display: block; margin-top: 0;">

    <div class="items clearfix">
        <?php 

            for($f=0;$f<3;$f++){
                $i=1;
                foreach ($articles_line as $pArticle) {

                    $cssBgImageOverwrite = "";
                $border = "";

                    switch($pArticle['mType']){

                        case 'yt':
                            $cssBgImageOverwrite = 'blue';
                        $border = ' kockaimgVid';
                            break;
                    }

                    echo "<div class='kocka2' >";

                ?>

                <div class='kocka2img<?=$border?>'>
                    <a class="mPhoto" href="javascript:"> <?

                            switch($pArticle['mType']){
                                case 'img':
                                ?>
                                <img src="<?=$url.'cache/'.$this->img_map->showImage($pArticle['mFile'],158,106,"exacttop");?>" alt="<?=$pArticle['caption']?>" title="<?=$pArticle['caption']?>" width="158" height="106" />
                                <?
                                $css_title = 'w2';
                                    break;

                                case 'yt':
                                ?>
                                <img src="<?=$url.'cache/'.$this->img_map->showImage($pArticle['mFile'].".jpg",158,106,"exacttop");?>" alt="<?=$pArticle['caption']?>" title="<?=$pArticle['caption']?>" width="158" height="106" />
                                <?
                                $css_title = 'w2_vid';
                                    break;
                            }

                        ?>

                        <div class="nadnaslov"><div class="opct <?=$cssBgImageOverwrite;?> <?=$css_title?>"></div><span><?
                                    if ($pArticle['mType']=='yt'){
                                        echo 'Video';
                                    }else{
                                        if(strlen($pArticle['uptitle'])>25){
                                            echo $pArticle['cName'];
                                        }else echo $pArticle['uptitle']; 
                                    }

                            ?></span></div>
                    </a>

                </div>
                <?

                    echo '<div style="clear: both;"></div>';
                    echo "<h4><a class='mLink' href='javascript:'>{$pArticle['title']}</a></h4>";

                    echo "</div>";

                    $i++;
                }
            }
        ?>


    </div>

</div>
<?if(count($articles_line)>0){?>
    <script type="text/javascript">
        
        var bColor;

        $('.mPhoto').hover(
        function() {

            bColor = $(this).parent().css('border-bottom'); 
            $(this).parent().css('border-bottom', '2px solid #dedede'); 
            $(this).parent().next().next().find('a.mLink').css('color', '#FD1900');
        },
        function() {
            $(this).parent().css('border-bottom', bColor);
            $(this).parent().next().next().find('a.mLink').css('color', '#222222'); 
        });

        $('.mLink').hover(
        function() {
            bColor = $(this).parent().parent().children('div:first').css('border-bottom');
            $(this).parent().parent().children('div:first').css('border-bottom', '2px solid #dedede');
            $(this).css('color', '#FD1900');
        },
        function() {
            $(this).parent().parent().children('div:first').css('border-bottom', bColor);
            $(this).css('color', '#222222'); 
        });

        $('.kocka2').hover(
        function() {
            bColor = $(this).find('.kocka2img').css('border-bottom');
            $(this).find('.kocka2img').css('border-bottom', '2px solid #dedede');
            $(this).find('h4 a.mLink').css('color', '#FD1900');
            $(this).animate({top: '-4'}, 100, 'linear'); 
        },
        function() {
            $(this).animate({top: '0'}, 100, 'linear');
            $(this).find('h4 a.mLink').css('color', '#222222');
            $(this).find('.kocka2img').css('border-bottom', bColor);
        });
    </script>
    <?}?>
    
    <div><button class="btn small reset" onclick="document.location.href = base_url + 'article/editform?id='+<?=$last[0]['id']?>;">Ažuriraj</button><button class="submit small icon i_arrow_right" onclick="document.location.href = base_url + 'article/preview';">Uredu</button></div>
</div>